package com.sxhuayuan.parking.controller.agent;

import com.sxhuayuan.parking.compenent.web.RespMessage;
import com.sxhuayuan.parking.controller.BaseController;
import com.sxhuayuan.parking.entity.Role;
import com.sxhuayuan.parking.service.RoleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Controller - 角色
 */
@RestController("agentRoleController")
@RequestMapping("/agent/role")
public class RoleController extends BaseController {

	@Resource(name = "roleServiceImpl")
	private RoleService roleService;

	/**
	 * 获取代理角色列表
	 *
	 * @return RespMessage
	 * @author helong
	 */
	@GetMapping("/all")
	public RespMessage getList() {
		List<Role> all = roleService.findByType(Role.Type.agent);
		return successResp(all);
	}

}